﻿namespace LogisticsTrackingWebApi_V2.Models
{

    /// <summary>
    /// 物流信息
    /// </summary>
    public class LogisticsInfo
    {
        /// <summary>
        /// 物流单号
        /// </summary>
        public string TrackingNumber { get; set; } = string.Empty;

        /// <summary>
        /// 公司代码
        /// </summary>
        public string CompanyCode { get; set; } = string.Empty;

        /// <summary>
        /// 公司名称
        /// </summary>
        public string CompanyName { get; set; } = string.Empty;

        /// <summary>
        /// 物流状态
        /// </summary>
        public LogisticsStatus Status { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        public DateTime LastUpdated { get; set; }

        /// <summary>
        /// 物流轨迹记录
        /// </summary>
        public List<TrackingRecord> TrackingRecords { get; set; } = new List<TrackingRecord>();
    }

    /// <summary>
    /// 物流状态枚举
    /// </summary>
    public enum LogisticsStatus
    {
        /// <summary>
        /// 未知
        /// </summary>
        Unknown,
        /// <summary>
        /// 已下单
        /// </summary>
        Ordered,
        /// <summary>
        /// 已揽收
        /// </summary>
        Collected,
        /// <summary>
        /// 运输中
        /// </summary>
        InTransit,
        /// <summary>
        /// 派送中
        /// </summary>
        OutForDelivery,
        /// <summary>
        /// 已送达
        /// </summary>
        Delivered,
        /// <summary>
        /// 已取消
        /// </summary>
        Cancelled
    }

    /// <summary>
    /// 物流轨迹记录
    /// </summary>
    public class TrackingRecord
    {
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime Time { get; set; }

        /// <summary>
        /// 地点
        /// </summary>
        public string Location { get; set; } = string.Empty;

        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; } = string.Empty;
    }

}
